﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ihg-theme-draft">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>

  <div class="container-fluid ihg-container has-ihg-sidemenu">

    <div class="ihg-breadcrumb">
      <ol class="breadcrumb border-breadcrumb">
        <li class="active">Add Session</li>
      </ol>
    </div>

    <div class="ihg-content-layout">

      <div class="col-xs-8">

        <form class="form-horizontal ihg-form" role="form" method="POST" action="${ctx.host}/session-settings" enctype="multipart/form-data" data-validate="true">
          
          <c:if test="${not empty errorMessage}">
            <div class="alert alert-danger">
              <i class="glyphicon glyphicon-remove"></i>&nbsp;&nbsp;${errorMessage}
            </div>
          </c:if>
          
          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Name</label>
            <div class="col-xs-8">
              <input type="text" class="form-control" name="name" data-validate="required" />
            </div>
          </div>

          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Description</label>
            <div class="col-xs-8">
              <textarea class="form-control" name="description" data-validate="required" rows="5"></textarea>
            </div>
          </div>

          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Time</label>
            <div class="col-xs-8">
              <div class="input-group">
                <input type="text" class="form-control date start-date" name="startDate" data-validate="required" placeholder="start time" readOnly/> <span class="input-group-addon">~</span> <input type="text" class="form-control date end-date" name="endDate" data-validate="required" placeholder="end time" readOnly/>
              </div>
            </div>
          </div>
          
          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Administrator</label>
            <div class="col-xs-4">
                <select class="select2 form-control" name="assessorOwner" data-validate="required">
                    <option value=""></option>
                    <c:forEach var="admin" items="${persist.administrators}">
                      <option value="${admin.id}">${admin.name}</option>
                    </c:forEach>
                </select>
            </div>
            <div class="col-xs-4">
                <select class="select2 form-control" name="delegateOwner" data-validate="required">
                    <option value=""></option>
                    <c:forEach var="admin" items="${persist.administrators}">
                      <option value="${admin.id}">${admin.name}</option>
                    </c:forEach>
                </select>
            </div>
          </div>
          
          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Assessor Wechat Group</label>
            <div class="col-xs-2">
              <a href="javascript:void(0);" type="button" class="btn btn-default file-container" style="width: 100px; height: 100px; font-size: 40px; line-height: 68px; color: #999; border-radius: 0;">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                <input name="assessorWechatGroupFile" type="file" accept="application/images" data-validate="required"></input>
              </a>
            </div>
            
            <label class="col-xs-3 control-label">Delegate Wechat Group</label>
            <div class="col-xs-2">
              <a href="javascript:void(0);" type="button" class="btn btn-default file-container" style="width: 100px; height: 100px; font-size: 40px; line-height: 68px; color: #999; border-radius: 0;">
                <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
                <input name="delegateWechatGroupFile" type="file" accept="application/images" data-validate="required"></input>
              </a>
            </div>
          </div>
          
          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Assessor</label>
            <div class="col-xs-6" style="padding-right: 0px;">
              <label class="form-control file-container">
                 <span data-placeholder="Click here to upload assessor excel"><span class="label label-primary" style="float: right; font-size: 14px;">select file</span></span>
                 <input name="assessors" type="file" accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" data-validate="required"></input>
              </label>
            </div>
            <div class="col-xs-2" style="padding-left: 5px;">
              <a href="${ctx.resource}/templates/assessor-template.xlsx" style="width: 100%;padding: 6px 12px;line-height: 36px;color: #D88362;text-align: center;" download="">Template</a>
            </div>
          </div>
          
          <div class="form-group ihg-form-group">
            <label class="col-xs-3 control-label">Delegate</label>
            <div class="col-xs-6"  style="padding-right: 0px;">
              <label class="form-control file-container">
                 <span data-placeholder="Click here to upload assessor excel"><span class="label label-primary" style="float: right; font-size: 14px;">select file</span></span>
                 <input name="delegates" type="file" accept="application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" data-validate="required"></input>
              </label>
            </div>
            <div class="col-xs-2" style="padding-left: 5px;">
              <a href="${ctx.resource}/templates/delegate-template.xlsx" style="width: 100%;padding: 6px 12px;line-height: 36px;color: #D88362;text-align: center;" download="">Template</a>
            </div>
          </div>
          
          <div class="modal-footer"></div>
          <div class="form-group ihg-form-group text-center">
            <button type="submit" class="btn btn-success btn-shadow btn-shadow-success x-btn">Submit</button>&nbsp;&nbsp;
            <button type="button" class="btn btn-default btn-shadow btn-shadow-default x-btn" data-dismiss="modal">Cancel</button>
          </div>
        </form>
      </div>

    </div>


  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>


  <d:resource root="${ctx.resource}/build" type="script" src="js/page/session/session-single-create.js" />
  <script type="text/javascript">
    require([ 'page/session/session-single-create' ], function(page) {
      page.init();
    })
  </script>
</body>

</html>
